package com.situ.day12;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ExceptionDemo {
	public static void main(String[] args) {
		try {
			fun();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
	}
	
	private static void fun() throws IllegalAccessException{
		System.out.println("ExceptionDemo.fun()");
		//....
		//这里做了一些非法的访问，认为这是一个严重的错误，我主动去抛出一个异常
		throw new IllegalAccessException("非法访问");
	}


	
	
	
	

	public static void main11(String[] args) {
		try {
			fun11();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}
	
	public static void fun11() throws FileNotFoundException {
		FileInputStream fileInputStream = new FileInputStream("a.txt");
	}
	
	
	
	
	
}
